package com.byit.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.byit.domain.quartz.JobLog;
import com.byit.mapper.JobLogMapper;
import com.byit.service.IJobLogService;
import com.byit.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 定时任务调度日志信息 服务层
 * 
 * @author morej
 */
@Service
public class JobLogServiceImpl extends ServiceImpl<JobLogMapper, JobLog> implements IJobLogService {

    @Autowired
    private JobLogMapper jobLogMapper;

    @Override
    public Page<JSONObject> selectAll(Page<JobLog> pageInfo, Map<String, Object> columnMap) {
        List<JSONObject> list = jobLogMapper.selectAll(pageInfo, columnMap);

        Page<JSONObject> page = PageUtil.transform(pageInfo);

        page.setRecords(list);

        return page;
    }
}
